Repository navigation
chore(deps): update module github.com/puzpuzpuz/xsync to v4 - #477
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v1.5.2→v4.5.0Release Notes
puzpuzpuz/xsync (github.com/puzpuzpuz/xsync)
v4.5.0Compare Source
Mapto more types #195Map#199MPMCQueue#200MPMCQueue#203Kudos to @llxisdsh, @jeremiah-masters, and @huynhanx03 for making this release happen.
Breaking changes
MPMCQueue's capacity specified inNewMPMCQueueis now implicitly rounded up to the next power of 2. For example,xsync.NewMPMCQueue[string](1000)means that the queue's capacity will be set to 1024.v4.4.0Compare Source
Mapfor integer keys #185Map.RangeRelaxedmethod for faster map iteration #187Map.DeleteMatchingmethod for batch entry deletion #186Read-heavy operations on
Mapwith integer keys are now 24-29% faster due to a more efficient hash function, as well as a number of micro-optimizations.RangeRelaxedis a much faster (~11x), lock-free alternative toRange. The downside is that the same key may be visited byRangeRelaxedmore than once if it is concurrently deleted and re-inserted during the iteration.RangeRelaxedshould be preferred overRangein all cases when weaker consistency is acceptable.DeleteMatchingdeletes all entries for which the delete return value of the input function is true. If the cancel return value is true, the iteration stops immediately. The function returns the number of deleted entries. The call locks a hash table bucket for the duration of evaluating the function for all entries in the bucket and performing deletions. It performs up to 20% faster thanRange+Delete, yet if the percentage of the entries to-be-deleted is low,RangeRelaxed+Deletecombination should be more efficient.v4.3.0Compare Source
Map.All#181Allis similar toRange, but returns aniter.Seq2, so is compatible with Go 1.23+ iterators. All of the same caveats and behavior fromRangeapply toAll.Kudos to @llxisdsh and @moskyb for making this release happen.
v4.2.0Compare Source
Map#178runtime.cheaprandinstead offastrand#177Introduces cooperative rehashing for
xsync.Mapthis means that goroutines that execute write operations, such asComputeorStore, may participate in table rehashing when the hash table grows or shrinks. From now on, table rehashing never spawns additional goroutines.This behavior is always enabled, so the
WithSerialResizefunction is now marked as deprecated and acts as a no-op.v4.1.0Compare Source
UMPSCQueue#168LoadAndDeleteandDeletein case of non-existingMapkey #167Mapresize #170UMPSCQueueis meant to serve as a replacement for a channel. However, crucially, it has infinite capacity. This is a very bad idea in many cases as it means that it never exhibits backpressure. In other words, if nothing is consuming elements from the queue, it will eventually consume all available memory and crash the process. However, there are also cases where this is desired behavior as it means the queue will dynamically allocate more memory to store temporary bursts, allowing producers to never block while the consumer catches up.From now on,
Mapspawns additional goroutines to speed up resizing the hash table. This can be disabled when creating aMapwith the newWithSerialResizesetting:Thanks @PapaCharlie and @llxisdsh for the contributions!
v4.0.0Compare Source
MapOf's hasher API is gone. The default and only hash function is now based onmaphash.Comparable.Map'sComputeAPI now supports no-op (cancel) compute operation.Thanks @PapaCharlie for making this release happen
Migration notes
*Oftypes are kept as type aliases for the renamed data structures to simplify the migration, e.g.MapOfis an alias forMap.NewMapOfPresizedfunction is gone.NewMapcombined withWithPresizeshould be used instead.Map.Computemethod now expectsvalueFnto return aComputeOpvalue instead of a boolean flag. That's to support compute operation cancellation, so that the call does nothing.Map.LoadOrTryComputemethod is renamed toLoadOrCompute. The oldLoadOrComputemethod is removed as it was redundant.v3.5.1Compare Source
LoadOrComputeandLoadOrTryCompute#154v3.5.0Compare Source
SPSCQueue/SPSCQueueOf#152LoadOrTryComputemethod toMap/MapOf#153Thanks @mattjohnsonpint for suggesting the map enhancement.
v3.4.1Compare Source
ToPlainMap/ToPlainMapOfutility functions #151Thanks @KiddoV for suggesting this enhancement.
v3.4.0Compare Source
RBMutex#138 and #140Map/MapOfcapacity calculation forWithPresize#139RBMutexnow has methods for optimistic locking:Thanks @kkroo for the contribution.
v3.3.1Compare Source
NewMapOfWithHasherfunction #137Adds
NewMapOfWithHasherfunction to support custom hash functions inMapOf:Some custom hash functions may be faster than the built-in function if the lack of DDOS protection is fine.
Murmur3 finalizer:
Built-in hash function:
v3.3.0Compare Source
MapOflookups #134Map/MapOfstatistics #133Introduces meta memory and SWAR-based lookups similar to C++'s
absl::flat_hash_maphash table (https://abseil.io/docs/cpp/guides/container). The lookups are now up to 30% faster.Also, reduces
MapOf's memory overhead: each bucket now holds up to 5 entries instead of 3.Map/MapOfstatistics are available viam.Stats(). They may be used for diagnostic purposes.v3.2.0Compare Source
Adds options support to the
NewMap/NewMapOffunctions. AMapOfcan now be created like this:NewPresizedMap/NewPresizedMapOffunctions are deprecated. Use theWithPresizeoption instead.Also, adds
WithGrowOnlyoption. It configures newMap/MapOfinstance to be grow-only. This means that the underlying hash table grows in capacity when new keys are added, but does not shrink when keys are deleted. The only exception to this rule is theClearmethod which shrinks the hash table back to the initial capacity.Grow-only maps are more efficient in the case of oscillating map size, i.e. when the map frequently grows and then shrinks in size.
v3.1.0Compare Source
NewMapPresized/NewMapOfPresized's argument is now treated as the minimal table capacity. The underlying hash table won't shrink beyond the specified capacity.Also, fixes and improves godoc.
v3.0.2Compare Source
Thanks @mdumandag for reporting the issue.
v3.0.1Compare Source
Map/MapOfresize (#111)Thanks @klauspost for reporting this issue.
v3.0.0Compare Source
All
New*MapOf*functions are now replaced with theNewMapOfandNewMapOfPresizedfunctions. There is no longer a need to provide a user-defined hash function.Kudos go to @destel
v2.5.1Compare Source
v2.5.0Compare Source
MPMCQueueOf) (#104)v2.4.1Compare Source
v2.4.0Compare Source
MapandMapOf(#86)Map/MapOf.Range(#87 and #88)v2.3.2Compare Source
Thanks @felixge for holding a comprehensive (and lengthy) benchmarks run.
v2.3.1Compare Source
MapOfnow takes full advantage of Go generics: less GC pressure, less atomic operations on reads, also improved integer hash functionv2.3.0Compare Source
MapOfinteger hash function (#76)RBMutexfootprint and thread-to-slot distribution (#75)NewRBMutex()function must be called now to initialize aRBMutex.v2.2.0Compare Source
Counterthread-to-stripe distribution (#71 and #74)NewCounter()function must be called now to initialize aCounter.v2.1.0Compare Source
Thanks @psyhatter and @veqryn for the contribution.
v2.0.2Compare Source
v2.0.1Compare Source
v2.0.0Compare Source
MapOfAPI in favor of the standardhash/maphashpackage. The main difference is in thehasherargument expected in theNewTypedMapOffunction.Configuration
📅 Schedule: (UTC)
* 0-3 * * 1)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.